<html>
<head>
<title><?= $config['site_name'] ?></title>
<?
if(isset($redirect)) {
	echo '<META HTTP-EQUIV="Refresh" CONTENT="0;URL=' . $redirect . '">';	
}
?>    <!-- Le styles -->
    <link href="<?= basePath() ?>/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
    </style>
    <link href="<?=basePath()?>/css/bootstrap-responsive.css" rel="stylesheet">
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="<?= $config['site_address']?>">the campus list</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
			<?
			for($i = 0; $i < count($page_display); $i++) {
			echo '<li><a href=' . $page_display[$i] . '>' . $page_display_names[$i] . '</a></li>';
			}
			?>
            </ul>
            <? if(isset($_SESSION['user_id'])) { ?>
            	<p class="navbar-text pull-right">
              	<a href="#" class="navbar-link"><?= getCredits($_SESSION['user_id']) ?> | <?= $name ?></a>
            </p>
            <? } else { ?>
            <form class="navbar-form pull-right" action="index.php">
              <input class="span2" type="text" placeholder="Email" name="email">
              <input class="span2" type="password" placeholder="Password" name="password">
              <button type="submit" class="btn">Sign in</button>
            </form>
            <? } ?>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">
            <? if(isset($_SESSION['user_id'])) { ?>
    		<form class="form-search" action="search/">
         	 	<div class="input-append">
            <input type="text" class="span8 search-query" placeholder="search for ________" name="query" <? if(isset($query)) echo "value=\"$query\""; ?>>
            <button type="submit" class="btn">Search</button>
          </div>
          </form>
          <? } ?>
<div id="message">
<?
if(isset($error)) {
	echo "<div id=\"error\"><p>$error</p></div>";
} else if(isset($success)) {
	echo "<div id=\"error\"><p>$success</p></div>";
} else if(isset($warn)) {
	echo "<div id=\"error\"><p>$warn</p></div>";
} else if(isset($info)) {
	echo "<div id=\"error\"><p>$info</p></div>";
}
?>
</div>
